package com.vlong.town.controller.server.banner;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.vlong.town.entity.banner.BannerInfo;
import com.vlong.town.service.banner.BannerInfoService;

/**
 * Banner图Rest接口Controller
 * @author Assassin
 */
@RequestMapping("/rest/banner")
@RestController
public class BannerRestController {

    // Fields

    @Autowired
    private BannerInfoService bannerInfoService;//  Banner图信息业务实现类

    /**
     * 查询Banner信息
     * @param type 类型
     * @return List<BannerInfo>
     */
    @RequestMapping("/type/{type}")
    public List<BannerInfo> getCBanner(@PathVariable(value="type", required = true) String type) {
        List<BannerInfo> bannerInfoList = this.bannerInfoService.queryList(Integer.parseInt(type), null, null);
        return bannerInfoList;
    }

}
